package com.example.aop.controller;

import com.example.aop.config.MyAspect;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RequestMapping("/test")
@RestController
public class TestController {
    @RequestMapping("/t1")
    public void test1() {
        log.info("test1====");
    }
    @RequestMapping("/t2")
    public String test2() {
        log.info("test2======");
        return "test2";
    }

    @MyAspect
    @RequestMapping("/t3")
    public Integer test3() {
        log.info("test3========");
        return 3;
    }
    @RequestMapping("/t4")
    public void test4() {
        log.info("test4========");
        int i = 1 / 0;
    }

}
